package ro.licenta.utilities.receiver;

import ro.licenta.utilities.interfaces.ActivityInterface;
import ro.licenta.utilities.services.MyService;
import ro.licenta.utilities.utils.StaticUtils;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class MyUpdateBroadcastReceiver extends BroadcastReceiver {

	private ActivityInterface mAct;

	@Override
	public void onReceive(Context context, Intent intent) {

		if (StaticUtils.ACTION_RESP.equals(intent
				.getAction())){
			mAct.updateUi();
		}

		if ("android.intent.action.BOOT_COMPLETED".equals(intent.getAction())) {
			Intent serviceLauncher = new Intent(context, MyService.class);
			context.startService(serviceLauncher);
		}
		
	}

	public MyUpdateBroadcastReceiver(ActivityInterface act) {
		mAct = act;
	}
}
